package com.baizhi.webservice.impl;

import com.baizhi.entity.User;
import com.baizhi.service.UserService;
import com.baizhi.webservice.UserWebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.jws.WebService;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import java.util.List;

@WebService
@Component
public class UserWebServiceImpl implements UserWebService {

    @Autowired
    private UserService userService;

    @Path("/webfind")
    @GET
    @Override
    public User getUser(String id) {
        System.out.println("这是远程访问的请求!");
        return userService.getUser(id);
    }

    @Path("/webfindall")
    @Override
    public List<User> findAll() {
        System.out.println("这是通过远程访问的请求!");
        return userService.findAll();
    }

}
